const app = getApp()
 
Page({
 
  /**
   * 页面的初始数据
   */
  data: {
    result: ''
  },
 
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
 
  },
  
  getScancode: function () {
    var _this = this;
    
    wx.scanCode({
      success: (res) => {
        var result = res.result;
 
        _this.setData({
          result: result,
 
        })
      }
    })
 
  }
})